﻿using ScienceRpcServe.Protos;

namespace ScienceRpcServe.Utils;

public static class HistoryImageRecordExtension
{
    public static RecordSearchResponse ToRecordSearchResponse(this List<ImageRecord> records)
    {
        var rs = new RecordSearchResponse();

        foreach (var rd in records)
        {
            rs.ImageRecords.Add(new ImageRecord()
            {
                Id = rd.Id,
                PatientName = rd.PatientName,
                SeriesDescription = rd.SeriesDescription,
                CreateTime = rd.CreateTime,
                Dimension = rd.Dimension,
                Directory = rd.Directory,
            });
        }

        return rs;
    }
}
